<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
  <title>Speak</title>
  <meta name="GENERATOR" content="Quanta Plus">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<hr>
<h2>INSTALLATION</h2>
<hr>
Place the "<strong>speak</strong>" executable file in the command path, eg in <strong>/usr/local/bin</strong>
<p>
Place the "<strong>espeak-data</strong>" directory in /usr/share as <strong>/usr/share/espeak-data</strong>.<br>
Alternatively if it is placed in the user's home directory (i.e. <strong>/home/&lt;user&gt;/espeak-data</strong>)
then that will be used instead.
<p>
Dependencies.<br>
<strong>speak</strong> uses the PortAudio sound library (version 1.8), so you will need to have the <strong>libportaudio0</strong> library package installed.  It may be already, since it's used by other software, such as OpenOffice.org and the Audacity sound editor.
<p>&nbsp;<hr>
<h2>COMMAND OPTIONS</h2>
<hr>
<h3>Examples</h3>
To use at the command line, type:<br>
 &nbsp; <strong>speak "This is a test"</strong><br>
or<br>
 &nbsp; <strong>speak -f &lt;text file&gt;</strong>
<p>
Or just type<br>
 &nbsp; <strong>speak</strong><br>
followed by text on subsequent lines. Each line is spoken when
RETURN is pressed.<br>Use <strong>speak -x</strong> to see the corresponding phoneme codes.
<p>&nbsp;<hr>
<h3>Use with KDE Text-to-Speech (KTTS)</h3>
To add to KDE-Text-to-Speech Manager (KTTSMgr), use it as a "Command" talker
with "command for speaking texts" set to:<br>
   <strong>cat %f | speak --stdin -w %w</strong>
<p>
Note:
<ul>
<li>When used by the KTTS system, I noticed a slight background hiss with the speech, which is not present when I use <strong>speak</strong> directly from the command line. This was because KDE sound default was set to "8 bits" rather than 16 bits.
<li>KTTSMgr breaks the text into sentences to pass to the speech engine, but it mistakenly assumes sentence breaks when dots follow abbreviations and therefore pauses after the dots in "eg. Mr. John B. Smith etc."  Speaking a text file directly with <strong>speak</strong> gives better results in this respect.
<li>Speaking text from a web page using KTTS often causes headings and image captions to be run together with the following text as a single sentence.  Copying the text into a file and then using <strong>speak</strong> directly, with the <strong>-l</strong> option set, may help if this is a problem. 
</ul>
<p>&nbsp;<hr>
<h3>The Command Line Options</h3>
<dl>
<dt>
<strong>speak [options] ["words"]</strong><br>
<dd>Text input can be taken either from a file, from a string in the command, or from stdin.
<p>
<dt>
<strong>-f &lt;text file&gt;</strong><br>
<dd>Speaks a text file.
<p>
<dt>
<strong> --stdin</strong><br>
<dd>Takes the text input from stdin.
<p>
<dt>
If neither -f nor --stdin is given, then the text input is taken from "words" (a text string within double quotes). <br>If that is not present then text is taken from stdin, but each line is treated as a separate sentence.
<p>
<dt>
<strong>-a &lt;integer&gt;</strong><br>
<dd>Sets amplitude (volume) in a range of 0 to 20.  The default is 10.
<p>
<dt>
<strong>-p &lt;integer&gt;</strong><br>
<dd>Adjusts the pitch in a range of 0 to 99.  The default is 50.
<p>
<dt>
<strong>-s &lt;integer&gt;</strong><br>
<dd>Sets the speed in words-per-minute (for the default voice, others may
differ slightly). The default value is 160. I generally use a faster speed
of 168.  Range 80 to 320.
<p>
<dt>
<strong>-l &lt;integer&gt;</strong><br>
<dd>Line-break length, default value 0.  If set, then lines which are shorter
than this are treated as separate clauses and spoken separately with a
break between them.  This can be useful for some text files, but bad for
others.
<p>
<dt>
<strong>-v &lt;voice name&gt;</strong><br>
<dd>Sets a Voice for the speech. Voice files can specify a language,
different pitches, tonal qualities, and prosody for the voice.
See the "ReadMe_Voices" file. 
<p>
<dt>
<strong>-w &lt;wave file&gt;</strong><br>
<dd>Writes the speech output to a file in WAV format, rather than speaking it.
<p>
<dt>
<strong>--stdout</strong><br>
<dd>Writes the speech output to stdout rather than speaking it.
<p>
<dt>
<strong>-x</strong><br>
<dd>The phoneme mnemonics, into which the input text is translated, are
shown on stdout.
<p>
<dt>
<strong>-X</strong><br>
<dd>As -x, but in addition, details are shown of the pronunciation rule and dictionary list lookup.  This can be useful to see why a certain pronunciation is being produced.  Each matching pronunciation rule is listed, together with its score, the highest scoring rule being used in the translation.  "Found:" indicates the word was found in the dictionary lookup list, and "Flags:" means the word was found with only properties and not a pronunciation.  You can see when a word has been retranslated after removing a prefix or suffix.
<p>
<dt><strong>-q</strong><br><dd>
Quiet. No sound is generated.  This may be useful with the -x option.
<p>
<dt><strong>--compile[=&lt;voice name&gt;]</strong><br>
<dd>
Compile the pronunciation rule and dictionary lookup data from their source files in the current directory.  The Voice determines which language's files are compiled.  For example, if it's an English voice, then <em>english_rules</em>, <em>english_list</em>, and <em>english_extra</em> (if present), are compiled to replace <em>english_1</em> and <em>english_2</em> in the <em>speak-data</em> directory.  If no Voice is specified then the default Voice is used.
<p>
<dt><strong>--punct[="&lt;characters&gt;"]</strong><br>
<dd>
Speaks the names of punctuation characters when they are encountered in the text.  If &lt;characters&gt; are given, then only those listed punctuation characters are spoken, eg.  <code> --punct=".,;?"</code>
<p>
<dt>
<strong>-k &lt;integer&gt;</strong><br>
<dd>Indicates capital letters in the text.<br><code>-k1 </code> indictates with a sound.<br><code>-k2 </code> speaks "capital" before the word.<br> Higher values give an increase in pitch for the capitalized word, eg <code>-k20</code>
</dl>
<p>&nbsp;<hr>
<h3>The Input Text</h3>
As well as plain text, phoneme mnemonics can be used in the text input to <strong>speak</strong>.  They are enclosed within double square brackets.  Spaces are used to separate words and all stressed syllables must be marked explicitly.<br>
 &nbsp; eg: [[D,Is Iz sVm f@n'EtIk t'Ekst 'InpUt]]

<hr>
</body>
</html>
